/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vita.vitasolution.service.util.converters;

import javax.inject.Named;
import vita.vitasolution.db.entities.Case;
import vita.vitasolution.service.dto.ShortCase;

/**
 *
 * @author harker777
 */
@Named
public class CaseShortCaseConverter implements EntityDtoConverter<Case, ShortCase> {

	@Override
	public Case getEntityFromDto(ShortCase dto) {
		throw new UnsupportedOperationException();
	}

	@Override
	public ShortCase getDtoFromEntity(Case entity) {
		ShortCase dto = new ShortCase();

		dto.setId(entity.getId());
		dto.setCopiesNumber(entity.getCopiesNumber());
		dto.setCriteriaNumber(entity.getCriteriaSet().size());
		dto.setName(entity.getTitle());
		dto.setFund(entity.getFund());

		return dto;
	}
}
